﻿using Outdoors.ViewModels;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace Outdoors.AccentListItems
{
    public class AccentConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var item = value as int?;
            if (item is int) 
            {
                if (item > 25)
                    return App.Current.Resources["PhoneTextExtraLargeStyle"] as Style;
                else if (item > 15)
                    return App.Current.Resources["PhoneTextLargeStyle"] as Style;
                else if (item > 10)
                    return App.Current.Resources["PhoneTextTitle2Style"] as Style;
            }

            return App.Current.Resources["PhoneTextTitle3Style"] as Style;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return App.Current.Resources["PhoneTextTitle3Style"] as Style;
        }
    }
}
